<template>
    <div>
        <!-- 顶部滑动导航 -->
        <!-- <button  @tap="render">123</button> -->
         <div id="slider" class="mui-slider">
            <div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
                <div class="mui-scroll">
                    <a :class="['mui-control-item',item.id == 1 ? 'mui-active' : '']" v-for="item in title" :key="item.id" @click="render">
                        {{item.title}}
                    </a>
                </div>
            </div>
        </div>
        <!-- 懒加载图片列表 -->
        <ul>
            <router-link :to="'/home/photoInfo/' + item.id" tag="li" v-for="item in list1" :key="item.id" class="listpic">
                <img v-lazy="item.img">       
                <div class="info">
                    <h1 class="info_title">{{item.title}}</h1>
                    <div class="info_txt">{{item.txt}}</div>
                </div>
            </router-link>
        </ul>
    </div>
</template>

<script>
import mui from '../../assets/mui/dist/js/mui.min.js'
export default {
    data() {
        return {
            title: [{
                id: 1,
                title: 'FGO'
            }, {
                id: 2,
                title: '楚留香'
            }, {
                id: 3,
                title: '军师联盟'
            }, {
                id: 4,
                title: '剑网三'
            }, {
                id: 5,
                title: '随手存'
            }],
            list: '',
            list1: [{
                id: 1,
                img: './static/images/FGO1.jpg',
                title: 'Saber',
                txt: '唔姆唔姆，余是尼禄'
            },{
                id: 2,
                img: './static/images/FGO2.jpg',
                title: 'Lancer',
                txt: '紫色老...婆'
            },{
                id: 3,
                img: './static/images/FGO3.jpg',
                title: 'Archer',
                txt: '吾乃第六天魔王，织田信长'
            },{
                id: 4,
                img: './static/images/FGO4.jpg',
                title: 'Saber',
                txt: '对吾华丽父王的叛逆'
            },{
                id: 5,
                img: './static/images/FGO5.jpg',
                title: 'Saber',
                txt: '剑之所指，吾之所向'
            }],            
            list2: [{
                id: 1,
                img: './static/images/clx1.jpg',
                title: 'Saber',
                txt: '唔姆唔姆，余是尼禄'
            },{
                id: 2,
                img: './static/images/clx2.jpg',
                title: 'Lancer',
                txt: '紫色老...婆'
            },{
                id: 3,
                img: './static/images/clx3.jpg',
                title: 'Archer',
                txt: '吾乃第六天魔王，织田信长'
            },{
                id: 4,
                img: './static/images/clx4.jpg',
                title: 'Saber',
                txt: '对吾华丽父王的叛逆'
            },{
                id: 5,
                img: './static/images/clx5.jpg',
                title: 'Saber',
                txt: '剑之所指，吾之所向'
            },{
                id: 6,
                img: './static/images/clx6.jpg',
                title: 'Saber',
                txt: '剑之所指，吾之所向'
            }],
        }
    },
    methods: {
        render() {
            console.log(1);
        }
    },
    mounted() {        
        mui('.mui-scroll-wrapper').scroll({
            deceleration: 0.0005 
        });
    }
}
</script>

<style scoped>
    /* 基本样式 */
    .header[data-v-7ba5bd90] {
        z-index: 99!important;
    }
    ul {
        list-style: none;
        padding: 10px;
        margin: 0;
    }
    /* 图片 */
    .listpic {
        position: relative;
        /* overflow: hidden; */
        /* height: 180px; */
        background: #ccc;
        margin-bottom: 10px;
        box-shadow: 0 0 9px #999; 
    }
    img[lazy="loaded"] {
        width: 100%;
        height: auto;
        margin: auto;
        vertical-align: middle;
    }
    /* 图片信息 */
    .info {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, .4);
        color: white;
        padding: 0 10px;
        text-align: left;
        max-height: 84px;
    }
    .info_title {
        font-size: 14px;
    }
    .info_txt {
        font-size: 13px;
    }
</style>

